package cn.net.xyan.easy.webapp.base.service;

import cn.net.xyan.easy.webapp.base.entity.ConstantValue;
import cn.net.xyan.easy.webapp.base.entity.StatusAndType;
import com.fasterxml.jackson.databind.JavaType;

import java.util.List;

/**
 * Created by xiashenpin on 16/1/23.
 */
public interface ISystemConfigService {

    // 常量接口
    ConstantValue setupValue(String key,Object value,String describe);
    ConstantValue writeValue(String key,Object value);
    <T> T readValue(String key);
    <T> T readValue(String key,Class<T> valueType);
    <T> T readValue(String key,JavaType valueType);

    //枚举接口
    <T extends StatusAndType> T setupStatus(Class<T> type,Integer index,String title);
    <T extends StatusAndType> T  setupStatus(Class<T> type,Integer index,String title,boolean abandon);
    <T extends StatusAndType> T  readStatus(Class<T> type,Integer index);
    <T extends StatusAndType> T  readStatus(Class<T> type,String title);
    <T extends StatusAndType> List<T> allStatusForType(Class<T> type);
}
